package main

import "fmt"

func main()  {
	f()
	fmt.Println("Returned normally from f.")
}

func f()  {
	defer func() {
		if r:=recover();r!=nil {
			fmt.Println("Recovered in f ",r)
		}
	}()
	fmt.Println("Calling g.")
	g(0)
	fmt.Println("Return normal result from g.")
}

func g(i int)  {
	if i>3 {
		fmt.Println("i will create a Panicing!")
		i++
		panic(fmt.Sprintf("%v",i))
	}
	defer fmt.Println("Defer in g ",i)
	fmt.Println("Printing in g",i)
	g(i+1)
}